home *** CD-ROM | disk | FTP | other *** search
- Path: coranto.ucs.mun.ca!usenet
- From: saustin@terra.nlnet.nf.ca (Steve Austin)
- Newsgroups: comp.lang.c++
- Subject: Re: Can you overload a constructor?
- Date: Sun, 17 Mar 1996 17:04:31 GMT
- Organization: Kickham Productions
- Message-ID: <4ihgmj$5ij@coranto.ucs.mun.ca>
- References: <Do859K.K9B@watserv3.uwaterloo.ca> <31483CDC.4B0C@staff.ichange.com> <4ibqan$br5@si-nic.hrz.uni-siegen.de>
- NNTP-Posting-Host: n104h129.nlnet.nf.ca
- X-Newsreader: Forte Agent .99b.112
-
- plrunu@informatik.uni-siegen.de (Runu Knips) wrote:
-
- >Sorry, it is impossible to OVERLOAD a constructor.
-
- Nonsense. Overloaded constructors are an everyday part of the
- language. Why do you think it's possible to have a copy constructor?
-
- > A constructor is ALWAYS called, if there is one for a class.
-
- There has to be a constructor. How would the class get constructed
- otherwise? If you don't supply one, the compiler will.
-
- > And before it get called, any constructor for superclasses get called.
-
- The question isn't about inheritance. As stated, it's a simple
- question about constructor overloading.
-
- >... but you can overload and supress a virtual function
- >of a superclass.
-
- You cannot *overload* a base class function in a derived class, unless
- you redefine the base class function in the derived class.
-
- You are mixing up the notions of "overloading" and "overriding".
-
- Steve
-
-
-